package com.prs.crm.context;

import javax.persistence.Table;

import com.prs.crm.annotation.FlowActive;

public class DomainUtils {

	public static String getTableName(Class<?> entityClass)
	{
		  Table annotation = (Table)entityClass.getAnnotation(FlowActive.class);
		  if (annotation!=null)
		  {
			  return annotation.name();
		  }
		  else
		  {
			 String className = entityClass.getName();
			 return className.substring(className.indexOf(".")+1); 
		  }
	}
}
